package cn.wolfcode.wolf2w.business.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : 邓风来
 * @date : 2025/9/28 14:03
 */
@Configuration
public class StrategyRabbitConfig {
    /**
     * 策略队列
     * 持久化
     * 不排他
     * 不自动删除
     * @return
     */
    @Bean
    public Queue strategyQueue(){
        return new Queue("strategyQueue",true,false,false);
    }

    /**
     * Topic交换机
     *
     * @return
     */
    @Bean
    public TopicExchange strategyExchange(){
        return new TopicExchange("strategyExchange",true,false);
    }

    /**
     * Topic交换机绑定队列
     */
    @Bean
    public Binding strategyBinding(){
        return new Binding("strategyQueue", Binding.DestinationType.QUEUE,
                "strategyExchange","strategy.#",null);
    }
}
